package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.open.model.request.IeoVipRequest;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import com.novax.ex.activity.infrastructure.mapper.IeoVipLimitMapper;
import com.novax.ex.activity.infrastructure.entity.IeoVipLimit;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description vip限购数配置service
 * @Author Cody
 * @Date 2022/12/02/17:29
*/
@Service
public class IeoVipLimitService extends BaseService {

    @Resource
    private IeoVipLimitMapper ieoVipLimitMapper;

    @Override
    protected BaseMapper getBaseMapper() { return ieoVipLimitMapper; }

    public List<IeoVipLimit> findByIeoId(Long ieoId){
        return ieoVipLimitMapper.selectByIeoId(ieoId);
    }

    public IeoVipLimit selectByIeoIdAndVipLevel(Long ieoId ,IeoVipRequest vipRequest){
        return ieoVipLimitMapper.selectByIeoIdAndVipLevel(ieoId, null);
    }

    /**
     * 黄涛
     * 发现通过ieo id和vip水平
     *
     * @param ieoId    ieo id
     * @param vipLevel vip水平
     * @return {@link IeoVipLimit}
     */
    public IeoVipLimit findByIeoIdAndVipLevel(Long ieoId, Integer vipLevel) {
        return ieoVipLimitMapper.selectByIeoIdAndVipLevel(ieoId, vipLevel);
    }

}
